#ifndef FILTER_COMMON_H_H
#define FILTER_COMMON_H_H

#include <vector>
#include <string>
#include <streams.h>

bool GetCaptureCrossbarDevices(std::vector<IBaseFilter*>& crossbarFilterList, std::vector<std::wstring>& crossbarNameList);

HRESULT FindVideoCompressor(const std::wstring& format, IBaseFilter *&result);

HRESULT GetFreePin(IBaseFilter* filter, IPin*& result, PIN_DIRECTION dir);

HRESULT GetNextFilter(IBaseFilter* filter, PIN_DIRECTION dir, IBaseFilter*& nextFilter);

void PrintFilters(IBaseFilter* start,int level = 0);

HRESULT ConnectTwoFilter(IFilterGraph* filterGraph, IBaseFilter* fromFilter, IBaseFilter* toFilter);

void PrintAllFilters(IFilterGraph* filterGraph);

bool GetVideoCaptureDevices(std::vector<IBaseFilter*>& captureSourceFilterList, std::vector<std::wstring>& captureDeviceNameList);

bool GetAudioCaptureDevices(std::vector<IBaseFilter*>& captureSourceFilterList, std::vector<std::wstring>& captureDeviceNameList);

HRESULT SetCaptureSize(IPin* capPreviewOutputPin, int width, int height, int avgTimePerFrame = 400000);

HRESULT SetCaptureAvgTimePerFrame(IPin* capPreviewOutputPin,int avgTimePerFrame = 400000);

HRESULT FindSourceFilter(IFilterGraph* filterGraph, IBaseFilter*& result);

HRESULT RemoveAllFilter(IFilterGraph* filterGraph);

HRESULT RemoveAllFilter(IFilterGraph* filterGraph, const std::vector<IBaseFilter*> &exceptList);

#endif